Add comprehensive k6 load testing suite and OpenIddict password grant support#65
Merged
antosubash merged 14 commits intomainfrom Apr 3, 2026
Merged
Add comprehensive k6 load testing suite and OpenIddict password grant support#65antosubash merged 14 commits intomainfrom
antosubash merged 14 commits intomainfrom
Conversation
Introduces k6 load testing scenarios for all major API modules (products, orders, pages, auth, health) plus a mixed traffic simulation. Adds password grant flow to OpenIddict (opt-in via config, enabled in Development) so k6 can authenticate without browser-based PKCE. https://claude.ai/code/session_01RZaoqjwRTskgZbsfX5iHjT
- Add insecureSkipTLSVerify for development self-signed certs - Fix delete endpoint expected status codes (204 No Content) - Fix order creation to use real userId and productId (validated by API) - Replace /connect/userinfo with /api/users/me in auth test All 6 scenarios now pass at 100% check rate. https://claude.ai/code/session_01RZaoqjwRTskgZbsfX5iHjT
- Add dedicated marketplace.js scenario testing search (with query, category filters) and package detail endpoints (anonymous, no auth) - Add browse-marketplace action to mixed traffic simulation - Add make k6-marketplace target - Uses correct MarketplaceCategory enum values (All, Auth, Storage, etc.) https://claude.ai/code/session_01RZaoqjwRTskgZbsfX5iHjT
Add 6 new k6 test scenarios for full API coverage: - settings.js: Settings CRUD, definitions, user settings, menu management - users.js: User CRUD lifecycle (create, get, update, delete) - audit-logs.js: Query logs, stats with date range, CSV/JSON export - file-storage.js: File upload/download, folder listing, metadata - page-lifecycle.js: Full page lifecycle (create→publish→trash→restore→delete), tags, templates - hotspots.js: Hits all 31 endpoints with per-endpoint Trend metrics, sorted p95 latency report The hotspot scenario produces a ranked report flagging endpoints over 500ms (HOTSPOT) or 200ms (SLOW), output to both stdout and tests/k6/results/hotspot-report.txt. https://claude.ai/code/session_01RZaoqjwRTskgZbsfX5iHjT
New test scenarios after merging latest main: - background-jobs.js: List jobs (with filters), get by ID, list recurring jobs - feature-flags.js: List flags, check flag, toggle, create/delete overrides - tenants.js: Full CRUD lifecycle with hosts, status changes, and feature overrides Updated hotspots.js with 9 new endpoint metrics (list-jobs, list-recurring, list-flags, check-flag, list-tenants, create/get/delete-tenant, get-tenant-features). All tests verified passing with 100% checks and 0% http failures. https://claude.ai/code/session_01RZaoqjwRTskgZbsfX5iHjT
Deploying simplemodule-website with
|
| Latest commit: |
e453288
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8837256d.simplemodule-website.pages.dev |
| Branch Preview URL: | https://claude-add-k6-load-testing-l.simplemodule-website.pages.dev |
- Add tests/k6 as npm workspace with @types/k6 for type safety - Convert all 16 scenarios and 3 lib files from .js to .ts - Add proper type annotations: AuthResult, SetupData, interfaces - Add k6-summary.d.ts for the remote k6 summary module - Use k6 experimental_enhanced compatibility mode for TS support - All files pass biome lint and tsc --noEmit type checking https://claude.ai/code/session_01RZaoqjwRTskgZbsfX5iHjT
Mirrors the GitHub Actions CI workflow (lint, build, test, e2e) so developers can catch issues before creating a pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive k6 load testing framework for performance testing across all API modules, along with enabling OpenIddict password grant flow for development environments to support automated testing.
Key Changes
Load Testing Infrastructure (k6)
Test Library & Configuration (
tests/k6/lib/)config.js: Centralized configuration with environment variable overrides for base URL, credentials, and load profiles (smoke, load, stress)auth.js: OAuth2 password grant authentication helper with token managementhelpers.js: Utility functions for random data generation, response validation, and custom metrics trackingScenario Tests (
tests/k6/scenarios/)health.js: Basic health check endpoints (smoke test)auth.js: Authentication flow testingproducts.js,orders.js,pages.js: CRUD operations for core modulespage-lifecycle.js: Full page lifecycle including publish, unpublish, trash, restore, and permanent deletesettings.js: System and user settings managementusers.js: User management CRUD operationsaudit-logs.js: Audit log querying, filtering, and export functionalityfile-storage.js: File upload/download operationsmarketplace.js: Anonymous marketplace search and browsingbackground-jobs.js: Background job and recurring job listingfeature-flags.js: Feature flag management and checkingtenants.js: Multi-tenant management operationsmixed.js: Realistic mixed traffic simulation with weighted random action selectionhotspots.js: Comprehensive endpoint latency analysis with custom reporting to identify performance bottlenecksMakefile Integration
K6_PROFILEenvironment variableOpenIddict Configuration
OpenIddictModule.csto conditionally allow password grant flowOpenIddictSeedService.csto register password grant clientAllowPasswordGrantconfiguration flag inappsettings.Development.jsonProject Configuration
.gitignoreto exclude k6 test results directoryImplementation Details
hotspots.jsscenario includes per-endpoint latency tracking with custom reporting that flags endpoints exceeding 500ms p95 latency as hotspotsmixed.jsscenario uses weighted random selection to simulate realistic user behavior (read-heavy traffic patterns)https://claude.ai/code/session_01RZaoqjwRTskgZbsfX5iHjT